package edu.infomatik.tundra.data;

import java.util.Calendar;
import java.util.Date;

import edu.infomatik.tundra.logic.SprintBean;
import edu.infomatik.tundra.logic.SprintMetrics;
import edu.infomatik.tundra.logic.WorkBean;
import edu.infomatik.tundra.logic.WorkKinds;

public class MockSprintBean extends WorkBean implements IMockedBean<SprintBean>{
	private SprintBean mocked;
	
	MockSprintBean(String name, int idealSP, int estSP, Date dateCreated, Date scheduleDate, Date deadline, long projectId, 
				   SprintMetrics metrics, long capacitySP, int teamSize, long duration, boolean inProgress){
		mocked=new SprintBean();
		mocked.setName(name);
		mocked.setKind(WorkKinds.SPRINT);
		mocked.setIdealSP(idealSP);
		mocked.setEstSP(estSP);
		mocked.setDateCreated(dateCreated);
		mocked.setScheduleDate(scheduleDate);
		mocked.setDeadline(deadline);
		mocked.setInProgress(inProgress);
		mocked.setMetrics(metrics);
		mocked.setCapacitySP(capacitySP);
		mocked.setTeamSize(teamSize);
		mocked.setDuration(duration);
		mocked.setProjectId(projectId);
	}
	
	@SuppressWarnings("unused")
	private MockSprintBean() {}
	
	@SuppressWarnings("deprecation")
	public static MockTundraData getMockedDataFactory(){
		MockTundraData result = new MockTundraData();
		
		result.update(new MockSprintBean("Rasciscavanje sobe", 4, 7, new Date(110,Calendar.JULY,29), 
				                          new Date(110,Calendar.AUGUST,17),new Date(110, Calendar.AUGUST, 17),1, SprintMetrics.HOURS, 8, 2, 4, false ));
		result.update(new MockSprintBean("Hoblovanje", 240, 280, new Date(110,Calendar.JULY,29), 
                						  new Date(110,Calendar.AUGUST,18),new Date(110, Calendar.AUGUST, 18),1, SprintMetrics.MINUTES, 270, 1, 270, false ));
		result.update(new MockSprintBean("Farbanje sandolinom", 90, 80, new Date(110,Calendar.JULY,29), 
										  new Date(110,Calendar.AUGUST,18),new Date(110, Calendar.AUGUST, 18),1, SprintMetrics.MINUTES, 120, 1, 80, false ));
		result.update(new MockSprintBean("Lakiranje - 1. ruka", 240, 260, new Date(110,Calendar.JULY,29), 
                						  new Date(110,Calendar.AUGUST,19),new Date(110, Calendar.AUGUST, 19),1, SprintMetrics.MINUTES, 270, 1, 270, false ));
		result.update(new MockSprintBean("Lakiranje - 2. ruka", 90, 90, new Date(110,Calendar.JULY,29), 
                						  new Date(110,Calendar.AUGUST,19),new Date(110, Calendar.AUGUST, 19),1, SprintMetrics.MINUTES, 120, 1, 90,false ));
		result.update(new MockSprintBean("Lakiranje - 3. ruka", 120, 120, new Date(110,Calendar.JULY,29), 
                						  new Date(110,Calendar.AUGUST,20),new Date(110, Calendar.AUGUST, 20),1, SprintMetrics.MINUTES, 120, 1, 120, false ));
		result.update(new MockSprintBean("Postavljanje infrastrukture", 1, 2, new Date(110,Calendar.JULY,29), 
				  						  new Date(110,Calendar.AUGUST,20),new Date(110, Calendar.AUGUST, 20),1, SprintMetrics.DAYS, 2, 1, 2, false ));
		result.update(new MockSprintBean("Planinarenje na Majevici", 12, 24, new Date(110,Calendar.JULY,29), 
				  						  new Date(110,Calendar.AUGUST,8),new Date(110, Calendar.AUGUST, 8),0, SprintMetrics.HOURS, 24, 1, 17, false ));
		result.update(new MockSprintBean("Planinarenje na Rtnju", 12, 24, new Date(110,Calendar.JULY,28), 
				  						  new Date(110,Calendar.AUGUST,28),new Date(110, Calendar.AUGUST, 28),0, SprintMetrics.HOURS, 24, 1, -1, false ));
		result.update(new MockSprintBean("Programiranje logike Tundre", 120, 120, new Date(110,Calendar.JULY,29), 
				  						  new Date(110,Calendar.AUGUST,24),new Date(110, Calendar.OCTOBER, 1),5, SprintMetrics.MINUTES, 120, 1, 120, true ));
		return result;
	}

	@Override
	public SprintBean getMocked() {
		return mocked;
	}
	public short getMetrics() {
		return mocked.getMetrics();
	}
	public void setMetrics(SprintMetrics metrics) {
		mocked.setMetrics(metrics);
	}
	public double getCapacitySP() {
		return mocked.getCapacitySP();
	}
	public void setCapacitySP(double capacitySP) {
		mocked.setCapacitySP(capacitySP);
	}
	public int getTeamSize() {
		return mocked.getTeamSize();
	}
	public void setTeamSize(int teamSize) {
		mocked.setTeamSize(teamSize);
	}
	public long getDuration() {
		return mocked.getDuration();
	}
	public void setDuration(long duration) {
		mocked.setDuration(duration);
	}
}
